package com.kunbo.cn.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.kunbo.cn.authority.SecurityInterceptor;
@Configuration
public class MVCConfig extends WebMvcConfigurerAdapter{
	@Bean
    public SecurityInterceptor securityInterceptor() {
        return new SecurityInterceptor();
    }
 
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(securityInterceptor()).excludePathPatterns("/static/**")
                .excludePathPatterns("/error").addPathPatterns("/**");
    }

}
